Set a busy cursor while mounting the volume. Also, ref the chooser while
authorFederico Mena Quintero <federico@ximian.com>
Tue, 13 Jul 2004 18:25:48 +0000 (18:25 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Tue, 13 Jul 2004 18:25:48 +0000 (18:25 +0000)
2004-07-13  Federico Mena Quintero  <federico@ximian.com>

* gtk/gtkfilechooserdefault.c (shortcuts_activate_volume): Set a
busy cursor while mounting the volume.  Also, ref the chooser
while mounting, as we may re-enter.  Fixes #139376.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkfilechooserdefault.c

index 7e5ca73427a191f1fde5a77a17dc190535e03fbc..f72f8eb7ed4838a42b593f58a4061b14865c9249 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-07-13  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_activate_volume): Set a
+       busy cursor while mounting the volume.  Also, ref the chooser
+       while mounting, as we may re-enter.  Fixes #139376.
+
 2004-07-13  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_adjustment_changed): 
index 7e5ca73427a191f1fde5a77a17dc190535e03fbc..f72f8eb7ed4838a42b593f58a4061b14865c9249 100644 (file)
@@ -1,3 +1,9 @@
+2004-07-13  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_activate_volume): Set a
+       busy cursor while mounting the volume.  Also, ref the chooser
+       while mounting, as we may re-enter.  Fixes #139376.
+
 2004-07-13  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_adjustment_changed): 
index 7e5ca73427a191f1fde5a77a17dc190535e03fbc..f72f8eb7ed4838a42b593f58a4061b14865c9249 100644 (file)
@@ -1,3 +1,9 @@
+2004-07-13  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_activate_volume): Set a
+       busy cursor while mounting the volume.  Also, ref the chooser
+       while mounting, as we may re-enter.  Fixes #139376.
+
 2004-07-13  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_adjustment_changed): 
index 7e5ca73427a191f1fde5a77a17dc190535e03fbc..f72f8eb7ed4838a42b593f58a4061b14865c9249 100644 (file)
@@ -1,3 +1,9 @@
+2004-07-13  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_activate_volume): Set a
+       busy cursor while mounting the volume.  Also, ref the chooser
+       while mounting, as we may re-enter.  Fixes #139376.
+
 2004-07-13  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_adjustment_changed): 
index aa75188a6bed898438a7c87a0c92e0e5b2029b3f..fb034c91269b35cbe96dd1dcc58ba02ca9d80e61 100644 (file)
@@ -4840,12 +4840,22 @@ shortcuts_activate_volume (GtkFileChooserDefault *impl,
 {
   GtkFilePath *path;
 
+  /* We ref the file chooser since volume_mount() may run a main loop, and the
+   * user could close the file chooser window in the meantime.
+   */
+  g_object_ref (impl);
+
   if (!gtk_file_system_volume_get_is_mounted (impl->file_system, volume))
     {
       GError *error;
+      gboolean result;
+
+      set_busy_cursor (impl, TRUE);
 
       error = NULL;
-      if (!gtk_file_system_volume_mount (impl->file_system, volume, &error))
+      result = gtk_file_system_volume_mount (impl->file_system, volume, &error);
+
+      if (!result)
        {
          char *msg;
 
@@ -4855,14 +4865,21 @@ shortcuts_activate_volume (GtkFileChooserDefault *impl,
          error_message (impl, msg);
          g_free (msg);
          g_error_free (error);
-
-         return;
        }
+
+      set_busy_cursor (impl, FALSE);
+
+      if (!result)
+       goto out;
     }
 
   path = gtk_file_system_volume_get_base_path (impl->file_system, volume);
   change_folder_and_display_error (impl, path);
   gtk_file_path_free (path);
+
+ out:
+
+  g_object_unref (impl);
 }
 
 /* Opens the folder or volume at the specified index in the shortcuts list */